var app = getApp();
Page(Object.assign({}, {
    data:{
        page : {
            isend : false,
            doing : false,
            doo : 'jifen',
            pdata : {
                op : 'jifenlog',
                page : 1,
                status : 0,
            },
            waitf : 0,
            nodataf : 0,
        },
        datalist : [],
        inited : false,
        Menu: [{
            url: "/zofui_sales/pages/index/index",
            iconPath: "/images/menu01.png",
            selectedIconPath: "/images/menu01.png",
            title: "首页",
            type: "tabbar"
        }, {
            url: "/zofui_sales/jifen/index",
            iconPath: "/images/jf_a.png",
            selectedIconPath: "/images/jf_a1.png",
            title: "兑换"
        }, {
            url: "/zofui_sales/jifen/order",
            iconPath: "/images/menu04.png",
            selectedIconPath: "/images/menu04-on.png",
            title: "订单"
        }],
        isIPX : app.globalData.isIPX,
		siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;

        app.com.auth(function(user){
            app.com.getPage(self,self.data.page,20,function(res){
                var data = res.data.data;
                self.setData({
                   datalist : data.list,
                   Pagetheme : res.data.data.params.style,
                   sharedata : res.data.data.sharedata,
                },function(){
                    self.setData({
                        inited : true,
                    });
                });

                wx.setNavigationBarTitle({
                  title:  res.data.data.params.jfbname +'记录',
                });

            },false,function(res){
                app.com.alert(res.data.message);
            });
        });
    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.params.umname,
            path: '',
        }
    },
    onReachBottom : function(){
        var self = this;
        app.com.getPage(self,self.data.page,20,function(res){
            self.setData({
                datalist : self.data.datalist.concat(res.data.data.list)
            });
        });
    },
    onPullDownRefresh: function () {
        this.onLoad();
        wx.stopPullDownRefresh();
    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e,this.data.tid );
    },
    redirectto : function( e ){
        app.com.redirectto( e,this.data.tid );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    }
}))